package com.origin.netlibrary.netapi

import com.origin.netlibrary.interceptor.MoreBaseUrlInterceptor
import okhttp3.MultipartBody
import okhttp3.RequestBody
import retrofit2.Call
import retrofit2.http.*

interface RequestFormat {

// 根据urlTag 替换主机地址

    @GET
    fun get(
        @Url url: String, @QueryMap params: Map<String, String> = mutableMapOf(), @HeaderMap headers: Map<String, String> = mutableMapOf()
    ): Call<String>


    @FormUrlEncoded
    @POST
    fun post(
        @Url url: String, @FieldMap params: Map<String, String> = mutableMapOf(), @HeaderMap headers: Map<String, String> = mutableMapOf()
    ): Call<String>

    // public static final MediaType JSON = MediaType.parse("application/json; charset=utf-8");
    // RequestBody body = RequestBody.create(JSON, json);

    @Headers("Content-type:application/json")
    @POST
    fun postJson(
        @Url url: String, @Body requestBody: RequestBody, @HeaderMap headers: Map<String, String> = mutableMapOf()
    ): Call<String>

}